import * as React from "react";

export default function Callback() {
  const [count, setCount] = React.useState<number>(0);
    React.useEffect(()=>{
        console.log('callback重新渲染')
    })
  const handleClick = React.useCallback(() => {
    setCount(count);
  }, [count]);

  return (
    <div>
      Count:{count}
      <button onClick={handleClick}></button>
    </div>
  );
}
